package xyz.xtt.equity.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;

import xyz.xtt.equity.api.dto.TblUserBenefitByAssetIdDto;
import xyz.xtt.equity.api.enums.UserBenefitSourceTypeEnum;
import xyz.xtt.equity.client.request.TblUserBenefitDto;
import xyz.xtt.equity.entity.TblBenefit;
import xyz.xtt.equity.entity.TblBenefitPackage;

/**
 * <p>
 * 权益信息表 服务类
 * </p>
 *
 * @author dale
 * @since 2025-02-10
 */
public interface ITblBenefitService extends IService<TblBenefit> {

	List<TblBenefit> queryBenefitsByPackageIds(List<Long> packageIds);

	List<TblBenefit> queryBenefitsByPackageId(Long packageId);

	/**
	 * 查询用户权益数据
	 *
	 * @param appUserId    用户id
	 * @param benefitCodes 多个benefitCode逗号分隔
	 * @return
	 */
	Map<String, Integer> getUserBenefits(long appUserId, String benefitCodes);

	/**
	 * 权益发放同时记录权益领取记录
	 * 
	 * @param packageCode
	 * @param appUserId
	 * @param sendNum
	 * @param sourceTypeEnum
	 * @param sourceRefId
	 */
	void recordAndSendFreeBenefitPackage(String packageCode, long appUserId, int sendNum, UserBenefitSourceTypeEnum sourceTypeEnum, Long sourceRefId);

	/**
	 * 获取3日内VIP将要过期的用户id集合
	 *
	 * @param pageNo      页码
	 * @param pageSize    每页数量
	 * @param benefitCode 权益code
	 * @return
	 */
	List<TblUserBenefitDto> getExpiringUserBenefits(int pageNo, int pageSize, String benefitCode);

	void sendBenefitPackage(TblBenefitPackage benefitPackage, long appUserId, int sendNum, UserBenefitSourceTypeEnum sourceTypeEnum, Long sourceRefId);

	List<TblBenefitPackage> getBusinessCastingBenefit();

	TblUserBenefitByAssetIdDto getBenefitDetailInfo(String uid, String assetId);

}
